package org.jsystemtest.course.so;

import java.lang.reflect.Method;

import org.junit.Test;

import com.aqua.sysobj.conn.CliCommand;
import com.aqua.sysobj.conn.CliConnectionImpl;

import jsystem.extensions.analyzers.text.FindText;
import jsystem.framework.system.SystemObjectImpl;

public class CliObj extends SystemObjectImpl {

	public CliConnectionImpl cliConnection;

	
	public void init() throws Exception {
		super.init();
		HelloWorld.setLastName("lastName");
		
		//StringBuilder builder;
		
	}

	/**
	 * Asserting that file {fileName} exists in the current directory.
	 * 
	 * @param fileName
	 * 		fileName to search for
	 * @throws Exception
	 */
	@Test
	public void isFileExists(String fileName) throws Exception {
		
		
		// Creating command
		CliCommand command = new CliCommand("dir");
		command.addErrors("is not recognized as an internal or external command");
		command.addMusts(new String[] { "Directory of" });

		// Invoking command
		cliConnection.handleCliCommand("Searching for " + fileName, command);

		// Analyzing result
		setTestAgainstObject(cliConnection.getTestAgainstObject());
		FindText findText = new FindText(fileName);
		analyze(findText);
	}

}
